package com.chinasofti.suse.ssm.ssmintegrated.web;

import com.chinasofti.suse.ssm.ssmintegrated.model.EarthQuake;
import com.chinasofti.suse.ssm.ssmintegrated.service.EarthQuakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class EarthQuakeController {

    @Autowired
    private EarthQuakeService earthQuakeService;


    @RequestMapping("getEarthQuakeInfo")
    public String getEarthQuakeInfo(ModelMap mm){


        final List<EarthQuake> all = earthQuakeService.getAll();
        mm.put("earthQuakeList",all);

        return "earthQuakeInfoList";
    }
}
